home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISOAPEncoding.idl < prev    next >
Text File  |  2006-05-08  |  11KB  |  312 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 2001
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39.  
  40. interface nsISchemaType;
  41. interface nsIDOMElement;
  42. interface nsISOAPEncoder;
  43. interface nsISOAPDecoder;
  44. interface nsISOAPMessage;
  45. interface nsIVariant;
  46. interface nsISOAPAttachments;
  47. interface nsISchemaCollection;
  48. interface nsISOAPEncoding;
  49.  
  50. /** 
  51.  * This interface provides access to a collection of SOAP encodings
  52.  *   and schemas. The registry is owned by an encoding.
  53.  */
  54. [scriptable, uuid(9fe91a61-3048-40e3-99ef-e39ab946ae0b)]
  55. interface nsISOAPEncodingRegistry : nsISupports {
  56.   /**
  57.    * Get an associated encoding for a different encoding style.  If
  58.    *   there is no default associated encoding available for the
  59.    *   specified encoding style, then if aCreateIf is specified, one
  60.    *   is created, otherwise a null is returned.  Associated encodings
  61.    *   are the set of encodings that may be used and modified together
  62.    *   as a set.
  63.    *
  64.    * @param aStyleURI The style URI of the associated encoding.
  65.    *
  66.    * @param aCreateIf If true, then create the associated encoding if it
  67.    *   does not already exist, otherwise return the existing encoding.
  68.    *
  69.    * @return The associated encoding which corresponds to the
  70.    *   specified styleURI, or null if the spefied alternative encoding
  71.    *   does not exist and it was not requested that it be created.
  72.    */
  73.   nsISOAPEncoding getAssociatedEncoding(in AString aStyleURI,
  74.                                         in boolean aCreateIf);
  75.  
  76.   /**
  77.     * The schema collection used by the owning encoding and all 
  78.     *   associated encodings.
  79.     */
  80.   attribute nsISchemaCollection schemaCollection;
  81. };
  82.  
  83.  
  84. /**
  85.  * This interface keeps track of the current encoding style and
  86.  *   how objects should be encoded or decoded, as well as all
  87.  *   associated encodings.
  88.  *   <p>While two different nsSOAPCalls may have an encoding
  89.  *   for the same styleURI, by default the encoding object and all
  90.  *   associated encoding objects are local do not affect other
  91.  *   calls because the encodings are local and not associated, 
  92.  *   unless the same or associated encodings are explicitly set
  93.  *   on multiple calls.  When a call is invoked, the same encoding 
  94.  *   object is automatically set on the response message so that
  95.  *   decoders registered on the call encoding are automatically
  96.  *   applied to the response.
  97.  */
  98.  
  99. [scriptable, uuid(9ae49600-1dd1-11b2-877f-e62f620c5e92)]
  100. interface nsISOAPEncoding : nsISupports {
  101.  
  102.   /**
  103.    * The name of the encoding as it is known to SOAP.
  104.    */
  105.   readonly attribute AString styleURI;
  106.  
  107.   /**
  108.    * Get an associated encoding for a different encoding style.  If
  109.    *   there is no default associated encoding available for the
  110.    *   specified encoding style, then if aCreateIf is specified, one
  111.    *   is created, otherwise a null is returned.  Associated encodings
  112.    *   are the set of encodings that may be used and modified together
  113.    *   as a set.
  114.    *
  115.    * @param aStyleURI The style URI of the associated encoding.
  116.    *
  117.    * @param aCreateIf If true, then create the associated encoding if it
  118.    *   does not already exist, otherwise return the existing encoding.
  119.    *
  120.    * @return The associated encoding which corresponds to the
  121.    *   specified styleURI, or null if the spefied alternative encoding
  122.    *   does not exist and it was not requested that it be created.
  123.    */
  124.   nsISOAPEncoding getAssociatedEncoding(in AString aStyleURI,
  125.                                         in boolean aCreateIf);
  126.  
  127.   /**
  128.     * Set an encoder in the encoding.
  129.     *
  130.     * @param aKey The key to be associated with the encoder.
  131.     *
  132.     * @param aEncoder The encoder to be specified or null to eliminate
  133.     *   the encoder.
  134.     */
  135.   void setEncoder(in AString aKey, in nsISOAPEncoder aEncoder);
  136.  
  137.   /**
  138.     * Get an encoder from the encoding.
  139.     *
  140.     * @param aKey The key to be used to look up the encoder.
  141.     *
  142.     * @return The encoder.
  143.     */
  144.   nsISOAPEncoder getEncoder(in AString aKey);
  145.  
  146.   /**
  147.     * Set a decoder in the encoding.
  148.     *
  149.     * @param aKey The key to be associated with the decoder.
  150.     *
  151.     * @param aDecoder The decoder to be specified or null to eliminate
  152.     *   the decoder.
  153.     */
  154.   void setDecoder(in AString aKey, in nsISOAPDecoder aDecoder);
  155.  
  156.   /**
  157.     * Get a decoder from the encoding.
  158.     *
  159.     * @param aKey The key to be used to look up the decoder.
  160.     *
  161.     * @return The decoder.
  162.     */
  163.   nsISOAPDecoder getDecoder(in AString aKey);
  164.  
  165.   /**
  166.    * The default encoder invoked by all encoding calls. Appropriate calls
  167.    * to more-specific encoders, if any, must be dispatched by this default 
  168.    * encoder.  The default encoder typically looks up encoders by known 
  169.    * information such as explicit or implicit types.
  170.    */
  171.   attribute nsISOAPEncoder defaultEncoder;
  172.  
  173.   /**
  174.    * The default decoder invoked by all encoding calls. Appropriate calls
  175.    * to more-specific decoders, if any, must be dispatched by this default 
  176.    * decoder.  The default decoder typically looks up encoders by known 
  177.    * information such as explicit or implicit types.
  178.    */
  179.   attribute nsISOAPDecoder defaultDecoder;
  180.  
  181.   /**
  182.     * The schema collection used by this and all associated encodings.
  183.     */
  184.   attribute nsISchemaCollection schemaCollection;
  185.  
  186.   /**
  187.    * Encode the source variant
  188.    *
  189.    * @param aEncodings The encodings to be used.
  190.    *
  191.    * @param aEncodingStyleURI The encoding style
  192.    *
  193.    * @param aSource The variant to be encoded, soon to become a variant
  194.    *
  195.    * @param aNamespaceURI The namespace of the thing being coded
  196.    *
  197.    * @param aName The name of the thing being coded
  198.    *
  199.    * @param aSchemaType The schema type of the thing being encoded
  200.    *
  201.    * @param aDestination The node scope where the result will live.
  202.    *
  203.    * @param aAttachments Accumulates any attachments.
  204.    *
  205.    * @return The element which was inserted and encoded.
  206.    */
  207.   nsIDOMElement encode(in nsIVariant aSource,
  208.                        in AString aNamespaceURI,
  209.                        in AString aName,
  210.                        in nsISchemaType aSchemaType,
  211.                        in nsISOAPAttachments aAttachments,
  212.                        in nsIDOMElement aDestination);
  213.  
  214.   /**
  215.    * Decode the source DOM node
  216.    *
  217.    * @param aEncodings The encodings used to decode
  218.    *
  219.    * @param aEncodingStyleURI The encoding style
  220.    *
  221.    * @param aSource The DOM node to be decoded.
  222.    *
  223.    * @param aSchemaType The schema type of the source DOM node
  224.    *
  225.    * @param aAttachments Dispenses any attachments.
  226.    *
  227.    * @return The decoded variant, soon to become a variant, which is null if 
  228.    *   the operation failed or did not return a result.
  229.    */
  230.   nsIVariant decode(in nsIDOMElement aSource,
  231.                     in nsISchemaType aSchemaType,
  232.                     in nsISOAPAttachments aAttachments);
  233.   /**
  234.    * Map an external schema URI to an internal one.  In an
  235.    * ideal world, we don't need this, but schemas change URIs,
  236.    * and we wind up with inconsistencies between WSDL and
  237.    * exchanged documents.  The external URI must not be
  238.    * currently mapped and if output mapping is true, then
  239.    * the internal URI must be unique for output mapping.
  240.    *
  241.    * @param aExternalURI the external URI to be mapped.
  242.    *
  243.    * @param aInternalURI the internal URI to be mapped.
  244.    *
  245.    * @param aOutput If true, then re-map to the output
  246.    *   URI when outputting.
  247.    *
  248.    * @return boolean true if succeeded, false if the
  249.    *   mapping was not unique as required.
  250.    */
  251.   boolean mapSchemaURI(in AString aExternalURI,
  252.                     in AString aInternalURI,
  253.                     in boolean aOutput);
  254.  
  255.   /**
  256.    * Unmap an external schema URI as mapped by
  257.    * mapSchemaURI.
  258.    *
  259.    * @param aExternalURI the external URI to be mapped.
  260.    *
  261.    * @return boolean true if succeeded, false if the
  262.    *   mapping did not exist.
  263.    */
  264.   boolean unmapSchemaURI(in AString aExternalURI);
  265.  
  266.   /**
  267.    * Get an internal schema URI from an external one.
  268.    *
  269.    * @param aExternalURI the external URI which may
  270.    *   have been mapped.
  271.    *
  272.    * @return The corresponding internal URI (the
  273.    *   original is returned if it has not been mapped).
  274.    */
  275.   AString getInternalSchemaURI(in AString aExternalURI);
  276.  
  277.   /**
  278.    * Get an external schema URI from an internal one.
  279.    *
  280.    * @param aExternalURI the external URI which may
  281.    *   have been mapped.
  282.    *
  283.    * @return The corresponding internal URI (the
  284.    *   original is returned if it has not been mapped).
  285.    */
  286.   AString getExternalSchemaURI(in AString aInternalURI);
  287.  
  288. };
  289.  
  290. %{C++
  291. #define NS_SOAPENCODING_CID                            \
  292. { /* db612ec6-1dd1-11b2-a8bc-e6777bf70a30 */        \
  293.   0xdb612ec6, 0x1dd1, 0x11b2,                       \
  294.  {0xa8, 0xbc, 0xe6, 0x77, 0x7b, 0xf7, 0x0a, 0x30} }
  295. #define NS_SOAPENCODING_CONTRACTID \
  296. "@mozilla.org/xmlextras/soap/encoding;1"
  297. #define NS_SOAPENCODING_CONTRACTID_PREFIX \
  298. NS_SOAPENCODING_CONTRACTID "?uri="
  299. #define NS_DEFAULTSOAPENCODING_1_1_CID                            \
  300. { /* 06fb035c-1dd2-11b2-bc30-f6d8e314d6b9 */        \
  301.   0x06fb035c, 0x1dd2, 0x11b2,                       \
  302.  {0xbc, 0x30, 0xf6, 0xd8, 0xe3, 0x14, 0xd6, 0xb9} }
  303. #define NS_DEFAULTSOAPENCODING_1_1_CONTRACTID \
  304. NS_SOAPENCODING_CONTRACTID_PREFIX "http://schemas.xmlsoap.org/soap/encoding/"
  305. #define NS_DEFAULTSOAPENCODING_1_2_CID                            \
  306. { /* e0ee4044-1dd1-11b2-9d7e-8899d4d89648 */        \
  307.   0xe0ee4044, 0x1dd1, 0x11b2,                       \
  308.  {0x9d, 0x7e, 0x88, 0x99, 0xd4, 0xd8, 0x96, 0x48} }
  309. #define NS_DEFAULTSOAPENCODING_1_2_CONTRACTID \
  310. NS_SOAPENCODING_CONTRACTID_PREFIX "http://www.w3.org/2001/09/soap-encoding"
  311. %}
  312.